package com.java2007.hotel.dao;

import com.java2007.hotel.pojo.Order;

import java.sql.SQLException;
import java.util.List;

/**
 * 订单Dao
 * @author csl
 * @version V1.0
 * @date 2021/01/23
 **/
public interface OrderDao {
    /**
     * 查询所有订单
     * @return
     */
    List<Order> selectAll() throws SQLException;

    /**
     * 修改订单
     * @return
     */
    int updateOrderStatus(byte status,int id ) throws SQLException;

    /**
     * 根据桌子id查询订单
     * @param tableId
     * @return
     * @throws SQLException
     */
    List<Order> selectByTableId(int tableId) throws SQLException;


    /**
     * 根据桌子id订单
     * @param id
     * @return
     * @throws SQLException
     */
    Order selectById(int id) throws SQLException;
    /**
     * 增加一个订单
     * @param order
     * @return
     */
    int addOrder(Order order) throws SQLException;

    /**
     * 删除一个订单
     * @param id
     * @return
     */
    int delete(int id) throws SQLException;



    /**
     * 根据订单编号修改订单
     * @return
     */
    int updateOrderStatusByNumber(byte status,String number ) throws SQLException;



    /**
     * 根据订单查询订单
     * @param number
     * @return
     * @throws SQLException
     */
    Order selectByByNumber(String number ) throws SQLException;
}
